1. Field of the Invention
The present invention relates to digital telephone switches used to connect a calling telephone to a destination telephone through a public switched telephone network. More specifically, the present invention relates to digital telephone switches having a digital control system where software application tasks running on one or more microprocessors control the telephone switch hardware in real time.
2. Description of Related Art
Telephone switches are used to simultaneously handle multiple telephone signals by connecting originating telephones to destination telephones through the public switched telephone network (PSTN). Switches of this type must perform a variety of tasks, such as detecting incoming calls, providing voice prompts to callers, identifying the phone number dialed, selecting an available outgoing line, dialing the destination phone number, monitoring the switch hardware for error conditions, etc. The switch may also provide functions such as call echo reduction, filtering and signal compression.
Modern phone switches are digital, and receive incoming digital telephone phone signals in the form of digitized voice data with digital control data. A microprocessor within the telephone switch runs application tasks, in the form of computer programs, which handle the many jobs that must be completed in real time in order to keep and maintain the multiple telephone connections.
Many of the tasks to be accomplished by a digital telephone switch of this type need to repeated on a regular basis. For example, each incoming line to the telephone switch must be checked regularly to determine if there is any activity, such as an incoming call, a disconnect or an error condition. In some cases these repetitive tasks must be completed many times each second whenever the switch is operating. Other tasks may need to be completed after tens or hundreds of seconds have elapsed, or even longer. The tasks may have to be completed only a few times, or only subsequent to, or prior to, the completion of some other task. The timing for all of these tasks as well as the necessary communication between tasks must be handled by the programming that is part of the switch control system.
The prior art has generally handled the two issues of 1) timing of task operation, and 2) communication between tasks as two separate issues that are handled in different ways. Timing of regularly repeating tasks has heretofore been accomplished through the control system software programming using a plurality of timers set by the software. Upon completing the repetitive task, the timer is reset by the software. Upon expiration of the timer, the repetitive task runs again. In order to handle the numerous timing tasks that are needed, however, this technique results in a multitude of simultaneous timers that need to be managed.
At the same time, the control system needs to send control information back and forth between different portions of the control system program. For example, the portion of the control program monitoring the incoming phone lines needs to advise another portion of the control program that controls switching to redirect the incoming call to an outgoing line at the appropriate time.
In many cases this control information does not need to be acted upon immediately, but must be completed after a delay period. Conventional programming and control techniques provide for such a delay by setting another timer. The expiration of that timer causes the control information to be acted upon. Accordingly, timers may be set for a portion of the control program to complete its own operation on a repetitive basis or for another portion of the control program to initiate action according to some control information.
This plurality of timers results in control programs which are difficult to write and modify, and which are not easily expandable to multiple processor designs and to distributed computing environments.
Bearing in mind the problems and deficiencies of the prior art, it is therefore an object of the present invention to provide a telephone switch with a simplified control system that is easy to write and modify.
Another object of the present invention is to provide a telephone switch with a control system that is easily distributed among multiple processors.
A further object of the present invention is to provide a telephone switch with a control system in which the timing of repetitive tasks or delayed tasks is combined with the passing of control information.
The above and other objects, which will be apparent to those skilled in the art, are achieved in the present invention which is directed to a telephone switch having a simplified control system that integrates timing functions with the passing of control information. Telephone switch control is achieved by placing the control information that must be sent between tasks into mail messages and then controlling the delivery of such mail by specifying a delay period for delivery of the mail message, where desired. To repeat a function on a regular basis, a repeating task simply sends a mail message back to itself specifying the desired delay. A delayed mail message contains a destination task, which may be itself, control information which may be a function that is repeated on a regular basis, and a specified delay period. The delayed mail message is sent to a mail task, which holds this message until the desired time, then sends it to the destination task.
More specifically, the invention includes a telephone switch having at least one microprocessor adapted for running programming tasks and a mail task running at sequentially spaced time intervals on the at least one microprocessor. The mail task includes an incoming mail queue for receiving mail messages to be held by the mail task for a delay time specified in each mail message it receives. The mail task also includes an internal delayed mail queue for holding received mail messages for the specified delay time. A mail receiving subtask removes messages from the incoming mail queue and places them in the internal delayed mail queue and a mail sending subtask removes delayed mail messages from the internal delayed mail queue after the specified delay time, then sends each delayed mail message to a destination application task specified in the mail message.
The control system also includes a plurality of application tasks for controlling the operation of the telephone switch. Each application task also has an incoming mail queue for receiving mail messages directed to control the application task, a mail receiving subtask for removing mail messages from the incoming mail queue and acting upon control information specified in each mail message, and a mail sending subtask for sending mail messages to the incoming mail queue of the mail task. Each mail message sent to the mail task specifies a destination application task and includes control information and a specified delay time.
The invention also includes the method of controlling the telephone switch of the invention. The method includes the steps of running the mail task on the telephone switch, holding received mail messages in an internal delayed mail queue for a delay time specified in each mail message and running a plurality of application tasks to control the telephone switch. The method further includes the steps of sending delayed mail messages from application tasks to the mail task, the delayed mail messages specifying a destination application task, a delay time and control information to control the destination application task, and sending each delayed mail message from the mail task to the corresponding destination application task after the specified delay time for each delayed mail message has elapsed.
In the most highly preferred embodiment of the invention, the mail task runs repetitively, once for each time a countdown timer controlled by the operating system completes a countdown. The operating system resets and restarts the timer each time the countdown completes and the duration of the timer is sufficiently short to ensure that the mail task will run at least as often as the shortest desired delay time specified in a mail message. The mail task converts the specified delay time of each delayed mail message into a tic count by dividing the period of the countdown timer into the specified delay time, then decrements the tic count for each message once each time the mail task runs.